<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.15"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Bluetooth LE Mesh Library: Mesh Location Server</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  $(document).ready(initResizable);
/* @license-end */</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen_style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><a href="http://www.cypress.com/"><img alt="Logo" src="IFXCYP_one-line.png"/></a></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Bluetooth LE Mesh Library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.15 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('group__wiced__bt__mesh__location__server.html','');});
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#typedef-members">Typedefs</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Mesh Location Server<div class="ingroups"><a class="el" href="group__wiced__bt__mesh.html">LE Mesh</a> &raquo; <a class="el" href="group__wiced__bt__mesh__models.html">Mesh Models Library API</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">General Description</h2>
<p>The AIROC Mesh Location Server module provides a way for a client to set the Global and Local location for a mesh device. </p>
<p>Setup location can be retrieved by the same or different clients. The Location Server may also be configured to publish unsolicited messages with the location information to a specific node or to a group of nodes.</p>
<p>Two types of location information can be exchanged between the client and the server. The Global Location Data (see <a class="el" href="structwiced__bt__mesh__location__global__data__t.html">wiced_bt_mesh_location_global_data_t</a>) and the Local Location Data (see <a class="el" href="structwiced__bt__mesh__location__local__data__t.html">wiced_bt_mesh_location_local_data_t</a>).</p>
<p>On startup the application should call the wiced_bt_mesh_model_location_server_init function providing the callback to be executed when a Get or Set request is received from a mesh device. The application should call the wiced_bt_mesh_model_location_server_send function in response to a get request, a set request when reply is required or when application logic requires location information to be sent out. In the latter case the message will be sent out only if device is configured remotely with the destination address where the location status should be set to and and the application key to be used to secure the message. </p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a>
Typedefs</h2></td></tr>
<tr class="memitem:gade3fffd05bffd374336e26a780594062"><td class="memItemLeft" align="right" valign="top">typedef void()&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wiced__bt__mesh__location__server.html#gade3fffd05bffd374336e26a780594062">wiced_bt_mesh_location_server_callback_t</a>(uint8_t element_idx, uint16_t event, void *p_data)</td></tr>
<tr class="memdesc:gade3fffd05bffd374336e26a780594062"><td class="mdescLeft">&#160;</td><td class="mdescRight">Location Server callback.  <a href="#gade3fffd05bffd374336e26a780594062">More...</a><br /></td></tr>
<tr class="separator:gade3fffd05bffd374336e26a780594062"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga182e6633f09b22e33def5c3b343227b1"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wiced__bt__mesh__location__server.html#ga182e6633f09b22e33def5c3b343227b1">wiced_bt_mesh_model_location_server_init</a> (<a class="el" href="group__wiced__bt__mesh__location__server.html#gade3fffd05bffd374336e26a780594062">wiced_bt_mesh_location_server_callback_t</a> *p_callback, wiced_bool_t is_provisioned)</td></tr>
<tr class="memdesc:ga182e6633f09b22e33def5c3b343227b1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Location Server initialization.  <a href="#ga182e6633f09b22e33def5c3b343227b1">More...</a><br /></td></tr>
<tr class="separator:ga182e6633f09b22e33def5c3b343227b1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaf501d5b111e4100c464f2a1c6b99a1f7"><td class="memItemLeft" align="right" valign="top">wiced_bool_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wiced__bt__mesh__location__server.html#gaf501d5b111e4100c464f2a1c6b99a1f7">wiced_bt_mesh_model_location_server_message_handler</a> (<a class="el" href="structwiced__bt__mesh__event__t.html">wiced_bt_mesh_event_t</a> *p_event, uint8_t *p_data, uint16_t data_len)</td></tr>
<tr class="memdesc:gaf501d5b111e4100c464f2a1c6b99a1f7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Location Server Message Handler.  <a href="#gaf501d5b111e4100c464f2a1c6b99a1f7">More...</a><br /></td></tr>
<tr class="separator:gaf501d5b111e4100c464f2a1c6b99a1f7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga0549c6bcb0387593085c789248ba5969"><td class="memItemLeft" align="right" valign="top">wiced_bool_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wiced__bt__mesh__location__server.html#ga0549c6bcb0387593085c789248ba5969">wiced_bt_mesh_model_location_setup_server_message_handler</a> (<a class="el" href="structwiced__bt__mesh__event__t.html">wiced_bt_mesh_event_t</a> *p_event, uint8_t *p_data, uint16_t data_len)</td></tr>
<tr class="memdesc:ga0549c6bcb0387593085c789248ba5969"><td class="mdescLeft">&#160;</td><td class="mdescRight">Location Setup Server Message Handler.  <a href="#ga0549c6bcb0387593085c789248ba5969">More...</a><br /></td></tr>
<tr class="separator:ga0549c6bcb0387593085c789248ba5969"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga4e80009e6350f38795e567d86f2736b0"><td class="memItemLeft" align="right" valign="top">wiced_result_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__wiced__bt__mesh__location__server.html#ga4e80009e6350f38795e567d86f2736b0">wiced_bt_mesh_model_location_server_send</a> (uint16_t type, <a class="el" href="structwiced__bt__mesh__event__t.html">wiced_bt_mesh_event_t</a> *p_event, void *p_data)</td></tr>
<tr class="memdesc:ga4e80009e6350f38795e567d86f2736b0"><td class="mdescLeft">&#160;</td><td class="mdescRight">The application can call this function to send status message to the Location Client.  <a href="#ga4e80009e6350f38795e567d86f2736b0">More...</a><br /></td></tr>
<tr class="separator:ga4e80009e6350f38795e567d86f2736b0"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Typedef Documentation</h2>
<a id="gade3fffd05bffd374336e26a780594062"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gade3fffd05bffd374336e26a780594062">&#9670;&nbsp;</a></span>wiced_bt_mesh_location_server_callback_t</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">typedef void() wiced_bt_mesh_location_server_callback_t(uint8_t element_idx, uint16_t event, void *p_data)</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Location Server callback. </p>
<p>The Location Server callback is executed by the Mesh Models library on receiving a Get or a Set message from the peer. In case of the Set the application should update the location information. In case of the Get or if the reply variable is set to TRUE in the p_event structure, the application should call the wiced_bt_mesh_model_location_server_send function returning p_event back to the library. Otherwise p_event should be released.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">element_idx</td><td>Element Index of the model </td></tr>
    <tr><td class="paramname">event</td><td>The event that the application should process (see <a class="el" href="wiced__bt__mesh__models_8h.html#LOCATION_EVENT">Location Events</a>) </td></tr>
    <tr><td class="paramname">p_data</td><td>Pointer to the local/global location data</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None </dd></dl>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="ga182e6633f09b22e33def5c3b343227b1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga182e6633f09b22e33def5c3b343227b1">&#9670;&nbsp;</a></span>wiced_bt_mesh_model_location_server_init()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void wiced_bt_mesh_model_location_server_init </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="group__wiced__bt__mesh__location__server.html#gade3fffd05bffd374336e26a780594062">wiced_bt_mesh_location_server_callback_t</a> *&#160;</td>
          <td class="paramname"><em>p_callback</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">wiced_bool_t&#160;</td>
          <td class="paramname"><em>is_provisioned</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Location Server initialization. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">p_callback</td><td>The application callback function that will be executed by the mesh models library when application action is required, or when a reply for the application request has been received. </td></tr>
    <tr><td class="paramname">is_provisioned</td><td>If TRUE, the application is being restarted after being provisioned or after a power loss. If FALSE the model cleans up NVRAM on startup.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None </dd></dl>

</div>
</div>
<a id="gaf501d5b111e4100c464f2a1c6b99a1f7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaf501d5b111e4100c464f2a1c6b99a1f7">&#9670;&nbsp;</a></span>wiced_bt_mesh_model_location_server_message_handler()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">wiced_bool_t wiced_bt_mesh_model_location_server_message_handler </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structwiced__bt__mesh__event__t.html">wiced_bt_mesh_event_t</a> *&#160;</td>
          <td class="paramname"><em>p_event</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>p_data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>data_len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Location Server Message Handler. </p>
<p>Application can call this models library function to process a message received from the Location Client and targeted to the Generic Location Server model. The function parses the message and if appropriate calls the application back to perform functionality.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">p_event</td><td>Mesh event with information about received message. </td></tr>
    <tr><td class="paramname">p_data</td><td>Pointer to the data portion of the message </td></tr>
    <tr><td class="paramname">data_len</td><td>Length of the data in the message</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>WICED_TRUE if the message is for this company ID/Model combination, WICED_FALSE otherwise. </dd></dl>

</div>
</div>
<a id="ga0549c6bcb0387593085c789248ba5969"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga0549c6bcb0387593085c789248ba5969">&#9670;&nbsp;</a></span>wiced_bt_mesh_model_location_setup_server_message_handler()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">wiced_bool_t wiced_bt_mesh_model_location_setup_server_message_handler </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structwiced__bt__mesh__event__t.html">wiced_bt_mesh_event_t</a> *&#160;</td>
          <td class="paramname"><em>p_event</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint8_t *&#160;</td>
          <td class="paramname"><em>p_data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>data_len</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Location Setup Server Message Handler. </p>
<p>Application can call this models library function to process a message received from the Location Client and targeted to the Generic Location Setup Server model. The function parses the message and if appropriate calls the application back to perform functionality.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">p_event</td><td>Mesh event with information about received message. </td></tr>
    <tr><td class="paramname">p_data</td><td>Pointer to the data portion of the message </td></tr>
    <tr><td class="paramname">data_len</td><td>Length of the data in the message</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>WICED_TRUE if the message is for this company ID/Model combination, WICED_FALSE otherwise. </dd></dl>

</div>
</div>
<a id="ga4e80009e6350f38795e567d86f2736b0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga4e80009e6350f38795e567d86f2736b0">&#9670;&nbsp;</a></span>wiced_bt_mesh_model_location_server_send()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">wiced_result_t wiced_bt_mesh_model_location_server_send </td>
          <td>(</td>
          <td class="paramtype">uint16_t&#160;</td>
          <td class="paramname"><em>type</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structwiced__bt__mesh__event__t.html">wiced_bt_mesh_event_t</a> *&#160;</td>
          <td class="paramname"><em>p_event</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>p_data</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>The application can call this function to send status message to the Location Client. </p>
<p>The mesh event should contain information if this is a reply or an unsolicited message.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">type</td><td>Type of the message to be send to the Client (see <a class="el" href="wiced__bt__mesh__models_8h.html#LOCATION_EVENT">Location Events</a>) </td></tr>
    <tr><td class="paramname">p_event</td><td>Mesh event with the information about the message that has been received in the request, or created by the app for unsolicited message. </td></tr>
    <tr><td class="paramname">p_data</td><td>Depending on the type of the message this should point to the Global Location Data (<a class="el" href="structwiced__bt__mesh__location__global__data__t.html">wiced_bt_mesh_location_global_data_t</a>) or the Local Location Data (see <a class="el" href="structwiced__bt__mesh__location__local__data__t.html">wiced_bt_mesh_location_local_data_t</a>)</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>WICED_BT_SUCCESS if message has been queued for transmission. </dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath">
    <ul>
        <li class="footer">
            Generated for <b>Bluetooth LE Mesh Library</b> by <b>Cypress Semiconductor Corporation</b>.
            All rights reserved.
        </li>
    </ul>
</div>
</body>
</html>
